package Lista1;


import junit.framework.TestCase;


public class JTest3 extends TestCase {

	Konwersja conv = null;
		
	protected void setUp() throws Exception {
		super.setUp();
		conv = new Konwersja();
	}
	
	public void testOne()throws KonwersjaException{//powtorzyc dla roznych baz
		String number = conv.convertion(12,2);
		assertEquals(number, "1100");
	}
	
	public void testTernary()throws KonwersjaException{//powtorzyc dla roznych baz
		String number = conv.convertion(220,3);
		assertEquals(number, "22011");
	}
	
	
	public void testTwo() throws KonwersjaException{ //TRUE/FALSE
		String number1 = conv.convertion(12,2);
		String number2 = conv.convertion(11,2);
		assertTrue("False",Integer.parseInt(number1) > Integer.parseInt(number2));
		}

	public void testThree() throws KonwersjaException{
		try{
		conv.convertion(12,1);
		fail ("nie wylapalo wyjtku");
		}
		catch(KonwersjaException e){
		}
	}

	public void testFive()throws KonwersjaException{
		String number = conv.convertion(12,15);
		assertEquals(number, "12");
	}
	
	public void testSix()throws KonwersjaException{
		String number = conv.convertion(12,2);
		assertNotNull(number);
	}
	public void testTrue()throws KonwersjaException{
		String number = conv.convertion(12362, 2);
		assertTrue(number.equals("11000001001010"));
	}

	public void TearDown(){
		conv = null;
	}
}